<template>
    <div>
        <h1>搜索</h1>
        <van-search v-model="value" placeholder="请输入搜索关键词" />
        <van-grid :border="false" :column-num="2">
            <van-grid-item v-for="(v, i) in search" :key="i">
                <van-image
                    :src="v.goods_small_logo ? v.goods_small_logo : 'https://fastly.jsdelivr.net/npm/@vant/assets/apple-1.jpeg'" />
                {{ v.goods_name }}
            </van-grid-item>
        </van-grid>
    </div>
</template>

<script setup>
import { ref } from 'vue'
import { searchApi } from '@/api/api';
//瀑布流
let search = ref([])
const getsearch = () => {
    searchApi().then((res) => {
        search.value = res.data.message.goods
    })
}
getsearch()
</script>

<style lang="scss" scoped></style>